Skip to content

Update rc.rs docs #140483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update rc.rs docs #140483

wants to merge 1 commit into from

Conversation

baumanj
Copy link

@baumanj baumanj commented Apr 29, 2025

wrapped_add is used, not checked_add

`wrapped_add` is used, not `checked_add`
@rustbot
Copy link
Collaborator

rustbot commented Apr 29, 2025

r? @workingjubilee

rustbot has assigned @workingjubilee.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 29, 2025
@@ -3536,7 +3536,7 @@ impl<T> Default for Weak<T> {
}
}

// NOTE: We checked_add here to deal with mem::forget safely. In particular
// NOTE: We wrapping_add here to deal with mem::forget safely. In particular
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is confusing in a different way: the wrapping_add does not offer the protection anymore, the strong == 0 conditional does.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the very least, it should mention clearly what actually implements the guard that handles the mem::forget, if it's going to mention any code.

@workingjubilee
Copy link
Member

I think this requires more than a one-word change to make something that makes sense. At least in the current mistaken form it's obviously "checked_add by hand"

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 30, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 30, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants